<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Whisper: CBuffer Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Whisper
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle">
<div class="title">CBuffer Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="CBuffer" -->
<p>Dynamic push and pop Buffer for audio samples.  
 <a href="classCBuffer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="buffer_8h_source.html">buffer.h</a>&gt;</code></p>

<p><a href="classCBuffer-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCBuffer.html#a9aa6d54f4896c98dd9e2269969f3ca2a">CBuffer</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Dynamic push and pop Buffer for audio samples.  <a href="#a9aa6d54f4896c98dd9e2269969f3ca2a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCBuffer.html#ab5e8bcbbfc7920c3cca12094f211cea9">~CBuffer</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCBuffer.html#a1e70e071b74fd317d9298538f715b134">write</a> (const double *pData, unsigned int pCount)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCBuffer.html#a096be90e7c576dab87cc2a47637a5887">read</a> (double *pData, unsigned int pCount)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCBuffer.html#a0b2dda3651225aed1dfd14f79db8a50c">getUnprocessedBuffer</a> (unsigned int pCount)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCBuffer.html#a88a7cec4289ab6145db2be4db0dbbdb1">putProcessedBuffer</a> (double *pData, unsigned int pCount)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCBuffer.html#a00040b6054f9f0b74089e27ff23c856d">getInputBufferSize</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCBuffer.html#a7c1590c934d6e06913e21da138faf8ba">getOuputBufferSize</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">queue&lt; double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCBuffer.html#a471725e1d593b783bd660c81ff0bd5ea">mInputBuffer</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">queue&lt; double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCBuffer.html#a7759654d02659327cc40637bd5cfce48">mOutputBuffer</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Dynamic push and pop Buffer for audio samples. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>Bernhard Schildendorfer</dd></dl>
<p><a class="el" href="classCBuffer.html" title="Dynamic push and pop Buffer for audio samples.">CBuffer</a> provides a fixed length byte-buffer which indicates if it's full.</p>
<p><a class="el" href="classCBuffer.html" title="Dynamic push and pop Buffer for audio samples.">CBuffer</a> contains two FIFO Queues, which are called input-buffer and output-buffer. Data which is written to <a class="el" href="classCBuffer.html" title="Dynamic push and pop Buffer for audio samples.">CBuffer</a> is stored to the input-buffer, data which is read from <a class="el" href="classCBuffer.html" title="Dynamic push and pop Buffer for audio samples.">CBuffer</a> is read from the output-buffer. To transfer data between them, the method processBuffer() needs to be called. Manipulation to the buffer is possible via the byte* of isBufferReady(); </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a9aa6d54f4896c98dd9e2269969f3ca2a"></a><!-- doxytag: member="CBuffer::CBuffer" ref="a9aa6d54f4896c98dd9e2269969f3ca2a" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CBuffer::CBuffer </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Dynamic push and pop Buffer for audio samples. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>Bernhard Schildendorfer</dd></dl>
<p><a class="el" href="classCBuffer.html" title="Dynamic push and pop Buffer for audio samples.">CBuffer</a> provides a fixed length byte-buffer which indicates if it's full.</p>
<p><a class="el" href="classCBuffer.html" title="Dynamic push and pop Buffer for audio samples.">CBuffer</a> contains two FIFO Queues, which are called input-buffer and output-buffer. Data which is written to <a class="el" href="classCBuffer.html" title="Dynamic push and pop Buffer for audio samples.">CBuffer</a> is stored to the input-buffer, data which is read from <a class="el" href="classCBuffer.html" title="Dynamic push and pop Buffer for audio samples.">CBuffer</a> is read from the output-buffer. To transfer data between them, the method processBuffer() needs to be called. Manipulation to the buffer is possible via the byte* of isBufferReady(); </p>

</div>
</div>
<a class="anchor" id="ab5e8bcbbfc7920c3cca12094f211cea9"></a><!-- doxytag: member="CBuffer::~CBuffer" ref="ab5e8bcbbfc7920c3cca12094f211cea9" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CBuffer::~CBuffer </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a00040b6054f9f0b74089e27ff23c856d"></a><!-- doxytag: member="CBuffer::getInputBufferSize" ref="a00040b6054f9f0b74089e27ff23c856d" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int CBuffer::getInputBufferSize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the number of elements in the input buffer. </p>

</div>
</div>
<a class="anchor" id="a7c1590c934d6e06913e21da138faf8ba"></a><!-- doxytag: member="CBuffer::getOuputBufferSize" ref="a7c1590c934d6e06913e21da138faf8ba" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int CBuffer::getOuputBufferSize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the number of elements in the output buffer. </p>

</div>
</div>
<a class="anchor" id="a0b2dda3651225aed1dfd14f79db8a50c"></a><!-- doxytag: member="CBuffer::getUnprocessedBuffer" ref="a0b2dda3651225aed1dfd14f79db8a50c" args="(unsigned int pCount)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double * CBuffer::getUnprocessedBuffer </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>pCount</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get pCount elements of the unprocessed buffer. Elements of the input buffer are deleted.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pCount</td><td>The amount of elements to be retrieved </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The retrieved buffer elements </dd></dl>

</div>
</div>
<a class="anchor" id="a88a7cec4289ab6145db2be4db0dbbdb1"></a><!-- doxytag: member="CBuffer::putProcessedBuffer" ref="a88a7cec4289ab6145db2be4db0dbbdb1" args="(double *pData, unsigned int pCount)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CBuffer::putProcessedBuffer </td>
          <td>(</td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>pData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>pCount</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Writes pCount elements into the output buffer.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pData</td><td>The data to be written into the buffer </td></tr>
    <tr><td class="paramname">pCount</td><td>The size of the data array </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a096be90e7c576dab87cc2a47637a5887"></a><!-- doxytag: member="CBuffer::read" ref="a096be90e7c576dab87cc2a47637a5887" args="(double *pData, unsigned int pCount)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CBuffer::read </td>
          <td>(</td>
          <td class="paramtype">double *&#160;</td>
          <td class="paramname"><em>pData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>pCount</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Receives and removes pCount elements from the output buffer. If there is less data in the buffer than requested by pCount, additional zeros will be written.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pData</td><td>The array that the retrieved data is written on </td></tr>
    <tr><td class="paramname">pCount</td><td>The size of the data array </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a1e70e071b74fd317d9298538f715b134"></a><!-- doxytag: member="CBuffer::write" ref="a1e70e071b74fd317d9298538f715b134" args="(const double *pData, unsigned int pCount)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CBuffer::write </td>
          <td>(</td>
          <td class="paramtype">const double *&#160;</td>
          <td class="paramname"><em>pData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>pCount</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Stores pCount bytes in the buffer.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pData</td><td>The data to be stored in the buffer </td></tr>
    <tr><td class="paramname">pCount</td><td>The size of the data to be stored in the buffer </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>If the buffer is full, a byte pointer is returned to the beginning of the full buffer, null if buffer is not full </dd></dl>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a471725e1d593b783bd660c81ff0bd5ea"></a><!-- doxytag: member="CBuffer::mInputBuffer" ref="a471725e1d593b783bd660c81ff0bd5ea" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">queue&lt;double&gt; <a class="el" href="classCBuffer.html#a471725e1d593b783bd660c81ff0bd5ea">CBuffer::mInputBuffer</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a7759654d02659327cc40637bd5cfce48"></a><!-- doxytag: member="CBuffer::mOutputBuffer" ref="a7759654d02659327cc40637bd5cfce48" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">queue&lt;double&gt; <a class="el" href="classCBuffer.html#a7759654d02659327cc40637bd5cfce48">CBuffer::mOutputBuffer</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="buffer_8h_source.html">buffer.h</a></li>
<li><a class="el" href="buffer_8cxx.html">buffer.cxx</a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 25 2012 22:00:41 for Whisper by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
